/**
 * 
 */
package scriptrunner.execution;

import java.io.Serializable;

/**
 * @author Administrator
 * 
 */
public abstract class Function implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3938537312374824363L;

	/**
	 * 
	 */
	protected Function() {
	}

	/**
	 * @param id
	 * @param pl
	 */
	public Function(String id, ParameterList pl) {
		this.id = id.substring(0);
		this.pl = pl;
	}

	/**
	 * @param se
	 * @return
	 * @throws ExecuteErrorException
	 */
	abstract public ValueObject Execute(Session se)
			throws ExecuteErrorException;

	/**
	 * @return
	 */
	public ParameterList getParameterList() {
		return pl;
	}

	/**
	 * @return
	 */
	public String getId() {
		return id.substring(0);
	}

	/**
	 * @return
	 */
	public FuncSignature GetSignature() {
		return new FuncSignature(id, pl.getParameterCount());
	}

	protected ParameterList pl;
	protected String id;
}
